package com.back.demo.controller;


import com.back.demo.common.CommonResult;
import com.back.demo.controller.myVO.BasicVO.RegisterReqVO;
import com.back.demo.controller.myVO.BasicVO.RegisterResVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Api(tags = "演示接口")
@RestController
@RequestMapping("/my-api/demo")
public class DemoServer {
    @ApiOperation("Hello World接口")
    @GetMapping("/hello")
    public String hello() {
        return "Hello, world!";
    }

    @ApiOperation("测试接口")
    @PostMapping("/test")
    public CommonResult<RegisterResVO> hello(@RequestBody @Valid RegisterReqVO reqVO) {
        RegisterResVO result = new RegisterResVO();
        result.setRegisterResult("测试结果");
        return CommonResult.success(result);
    }
}